import { defineStore } from 'pinia'

export const useAppStore = defineStore('app', {
  state() {
    return {
      collapsed: false // 左侧菜单是否收起
    }
  },

  getters: {
    asideWidth(state) {
      return state.collapsed ? 'auto' : '200px'
    }
  },

  actions: {
    toggleCollapsed() {
      this.collapsed = !this.collapsed
    }
  }
})
